package com.crm.util;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;

import org.apache.log4j.Logger;
//import org.codehaus.groovy.util.Finalizable;

//import com.crm.view.VMenu;





public class Constants {
	public static final String ST_CUR_EURO = "EUROS";
	public static final String ST_CUR_DOLLAR = "DOLLARS";
	public static final String ST_CUR_YEN = "YENS";
	public static final String ST_CUR_RUPEE = "RUPEES";
	public static final String ST_CUR_SDOLLAR = "SINGAPOREDOLLARS";
	public static final String ST_CUR_POUND = "POUNDS";
	
	public static final String ST_EURO = "\u20ac";
	public static final String ST_PI="\u220F";
	public static final String ST_OHM="\u2126";
	public static final  String ST_YEN="\u00A5";
	public static final String ST_MICRO="\u00B5";
	public static String ST_LIRA="\u20A4";
	
	public static final String LOG_NAME="kkcircits_log4j.properties";
	public static final String TITLE="KK Circuits And Equipments";	
	public static final String ST_PENDING="Pending";
	public static final String ST_SOURCE_INFO_SENT="Source Sent";
	public static final String ST_SOURCE_INFO_PAR_IMPORT="Source Partially Imported";
	
	public static final String ST_SOURCE_INFO_RECEIVED="Source Imported";
	public static final String ST_SOURCES_COMPARED="Sources Compared";
	
	public static final String ST_GENERATED_QUOTATION="Generated Quotation";
	
	public static final String ST_GENERATED_SO="Generated SO";
	public static final String ST_GENERATED_INVOICE="Generated Invoice";
	public static final String ST_GENERATED_SUP_INVOICE = "Generated  Supplier Invoice";
	public static final String ST_GEN_PO="Generated PO";	
	public static final String ST_ABORT="Abort";
	public static final String ST_GENERATED_DC="Generated DC";
	public static final String ST_CLOSED="Closed";
	public static final String [] monNames={"January","February","March","April","May","June","July","August","September","October","November","December"};
	public static final Map<String,Integer> monthsMap=new HashMap<String,Integer>();
	public static final String SOURCE_SUBJECT="Please send source information";
	
	
	public static final String DELIVERY_CHALLAN="DCHALLAN";
	public static final String INVOICE="INVOICE";
	public static final String PURCHASE_ORDER="PURCHASEORDER";
	public static final String PROFORMA="PROFORMA";
	public static final String SOCOPY="SOCOPY";
	public static final String BANKGCOPY="BANKGCOPY";
	public static final String WARRENTYCOPY="WARRENTYCOPY";
	public static final String TECHNICAL_QUOTATION="TECHNICAL_QUOTATION";
	public static final String  QUOTATION="QUOTATION";
	
	public static final String  PENDING="PENDING";
	public static final String  PAID="PAID";
	public static final String  PENDING_90_10="90%/10%PENDING";
	
	public static final String ST_SEPARATOR="~";
	
	static Logger logger = Logger.getLogger(Constants.class.getName());
	static{
		monthsMap.put("January", 1);
		monthsMap.put("February", 2);
		monthsMap.put("March", 3);
		monthsMap.put("April", 4);
		monthsMap.put("May", 5);
		monthsMap.put("June", 6);
		monthsMap.put("July", 7);
		monthsMap.put("August", 8);
		monthsMap.put("September", 9);
		monthsMap.put("October", 10);
		monthsMap.put("November", 11);
		monthsMap.put("December", 12);
	}
	
	public static final String ST_SEL_ORG="Select Organisation";
	public static final String ST_SEL_DIV="Select Division";
	public static final String ST_SEL_USER="Select User";
	
	
	public static final String ST_TE="TenderEnquiry(TE)";
	public static final String ST_CP="CashPurchase(CP)";
	public static final String ST_BQ="BudgetaryQuotation(BQ)";
	
	
	public static final String ST_PS="Please Select";
	
	
	public static final Integer INT_0=Integer.valueOf(0);
	
	public static final SimpleDateFormat formatter= new SimpleDateFormat("yyyy-MM-dd");
	public static final SimpleDateFormat IST_DATE_FORMATER= new SimpleDateFormat("dd/MM/yyyy");
	public static final SimpleDateFormat DD_MM=	new SimpleDateFormat("dd-MM");
	public static final SimpleDateFormat DD_MM_YYYY=	new SimpleDateFormat("dd-MM-yyyy");
	public static final Map<String,Integer> status=new LinkedHashMap<String, Integer>();
	public static final Calendar cal=Calendar.getInstance();
	public static final String ST_PE_BODY = "We thank you for the valuable enquiry and we shall revert with the best quote on or before the due date.";
	public static final String ST_PE_SUB = "Your Enquiry Received";
	
	static{
		status.put(ST_PENDING, 1);
		status.put(ST_SOURCE_INFO_SENT, 2);
		status.put(ST_SOURCE_INFO_PAR_IMPORT,3);
		status.put(ST_SOURCE_INFO_RECEIVED, 4);
		status.put(ST_GENERATED_QUOTATION, 5);
		status.put(ST_GEN_PO, 6);
		status.put(ST_GENERATED_INVOICE, 7);
		status.put(ST_ABORT, 8);
		status.put(ST_CLOSED, 9);
	}
	public static Integer getStatus(String st) {
		return status.get(st);
	}
	public static int getStatusPriority(String s){
		Integer m=null;
		try {
			m= status.get(s);
			logger.info("M Value Is: "+m);
		} catch (Exception e) {
			e.printStackTrace();
		}
		if(m==null){
			m=0;
		}
		return m;
	}
	
	public static Integer getMonthNo(String mon) {
		return monthsMap.get(mon);
	}
	/*public static void removeTab(VMenu v) {

		try{if(v.searchTab!=null)v.getContentPane().remove(v.searchTab);}catch(Exception e){ e.printStackTrace();}
		try{if(v.clientTab!=null)v.getContentPane().remove(v.clientTab);}catch(Exception e){ e.printStackTrace();}
		try{if(v.adminTab!=null)v.getContentPane().remove(v.adminTab);}catch(Exception e){ e.printStackTrace();}
		try{if(v.currencyTab!=null)v.getContentPane().remove(v.currencyTab);}catch(Exception e){ e.printStackTrace();}
		try{if(v.SourceTab!=null)v.getContentPane().remove(v.SourceTab);}catch(Exception e){ e.printStackTrace();}
		try{if(v.SupplierTab!=null)v.getContentPane().remove(v.SupplierTab);}catch(Exception e){ e.printStackTrace();}
		try{if(v.CompanyTab!=null)v.getContentPane().remove(v.CompanyTab);}catch(Exception e){ e.printStackTrace();}
		try{if(v.impSrcTab!=null)v.getContentPane().remove(v.impSrcTab);}catch(Exception e){ e.printStackTrace();}
		try{if(v.expoSourceTab!=null)v.getContentPane().remove(v.expoSourceTab);}catch(Exception e){ e.printStackTrace();}
		try{if(v.enquiryTab!=null)v.getContentPane().remove(v.enquiryTab);}catch(Exception e){ e.printStackTrace();}
		try{if(v.newQuotTab!=null)v.getContentPane().remove(v.newQuotTab);}catch(Exception e){ e.printStackTrace();}
		try{if(v.srchEnqTab!=null)v.getContentPane().remove(v.srchEnqTab);}catch(Exception e){ e.printStackTrace();}
		try{if(v.compareSrcTab!=null)v.getContentPane().remove(v.compareSrcTab);}catch(Exception e){ e.printStackTrace();}
		try{if(v.supplyOrderTab!=null)v.getContentPane().remove(v.supplyOrderTab);}catch(Exception e){ e.printStackTrace();}
		try{if(v.invoiceTab!=null)v.getContentPane().remove(v.invoiceTab);}catch(Exception e){ e.printStackTrace();}
		try{if(v.pendingEnqTab!=null)v.getContentPane().remove(v.pendingEnqTab);}catch(Exception e){ e.printStackTrace();}
		try{if(v.executiveBusTab!=null)v.getContentPane().remove(v.executiveBusTab);}catch(Exception e){ e.printStackTrace();}
		try{if(v.pendingQuotTab!=null)v.getContentPane().remove(v.pendingQuotTab);}catch(Exception e){ e.printStackTrace();}
		try{if(v.pendingOrdTab!=null)v.getContentPane().remove(v.pendingOrdTab);}catch(Exception e){ e.printStackTrace();}
		try{if(v.poTab!=null)v.getContentPane().remove(v.poTab);}catch(Exception e){ e.printStackTrace();}
		try{if(v.dcTab!=null)v.getContentPane().remove(v.dcTab);}catch(Exception e){ e.printStackTrace();}
		try{if(v.printQuotTab!=null)v.getContentPane().remove(v.printQuotTab);}catch(Exception e){ e.printStackTrace();}
		try{if(v.invoicestatusTab!=null)v.getContentPane().remove(v.invoicestatusTab);}catch(Exception e){ e.printStackTrace();}
		try{if(v.pendingInvoicesTab!=null)v.getContentPane().remove(v.pendingInvoicesTab);}catch(Exception e){ e.printStackTrace();}
		try{if(v.supInvoicesTab!=null)v.getContentPane().remove(v.supInvoicesTab);}catch(Exception e){ e.printStackTrace();}
		try{if(v.stockTab!=null)v.getContentPane().remove(v.stockTab);}catch(Exception e){ e.printStackTrace();}
		try{if(v.businessTab!=null)v.getContentPane().remove(v.businessTab);}catch(Exception e) {e.printStackTrace();}
		
		
		if(v.searchTab!=null)v.searchTab.removeAll();
		v.searchTab=null;
		
		if(v.clientTab!=null)v.clientTab.removeAll();
		v.clientTab=null;
		
		if(v.adminTab!=null)v.adminTab.removeAll();
		v.adminTab=null;
		
		if(v.currencyTab!=null)v.currencyTab.removeAll();
		v.currencyTab=null;
		
		if(v.SourceTab!=null)v.SourceTab.removeAll();
		v.SourceTab=null;
		
		if(v.SupplierTab!=null)v.SupplierTab.removeAll();
		v.SupplierTab=null;
		
		if(v.CompanyTab!=null)v.CompanyTab.removeAll();
		v.CompanyTab=null;
		
		if(v.impSrcTab!=null)v.impSrcTab.removeAll();
		v.impSrcTab=null;
		
		if(v.expoSourceTab!=null)v.expoSourceTab.removeAll();
		v.expoSourceTab=null;
		
		if(v.enquiryTab!=null)v.enquiryTab.removeAll();
		v.enquiryTab=null;
		
		if(v.newQuotTab!=null)v.newQuotTab.removeAll();
		v.newQuotTab=null;
		
		if(v.srchEnqTab!=null)v.srchEnqTab.removeAll();
		v.srchEnqTab=null;
		
		if(v.compareSrcTab!=null)v.compareSrcTab.removeAll();
		v.compareSrcTab=null;
		
		if(v.supplyOrderTab!=null)v.supplyOrderTab.removeAll();
		v.supplyOrderTab=null;
		
		if(v.invoiceTab!=null)v.invoiceTab.removeAll();
		v.invoiceTab=null;
		
		if(v.pendingEnqTab!=null)v.pendingEnqTab.removeAll();
		v.pendingEnqTab=null;
		
		if(v.executiveBusTab!=null)v.executiveBusTab.removeAll();
		v.executiveBusTab=null;
		
		if(v.pendingQuotTab!=null)v.pendingQuotTab.removeAll();
		v.pendingQuotTab=null;
		
		if(v.pendingOrdTab!=null)v.pendingOrdTab.removeAll();
		v.pendingOrdTab=null;
		
		if(v.poTab!=null)v.poTab.removeAll();
		v.poTab=null;
		
		if(v.dcTab!=null)v.dcTab.removeAll();
		v.dcTab=null;
		
		if(v.printQuotTab!=null)v.printQuotTab.removeAll();
		v.printQuotTab=null;
		
		if(v.invoicestatusTab!=null)v.invoicestatusTab.removeAll();
		v.invoicestatusTab=null;
		
		if(v.pendingInvoicesTab!=null)v.pendingInvoicesTab.removeAll();
		v.pendingInvoicesTab=null;
		
		if(v.supInvoicesTab!=null)v.supInvoicesTab.removeAll();
		v.supInvoicesTab=null;
		
		if(v.stockTab!=null)v.stockTab.removeAll();
		v.stockTab=null;
		
		try{v.getContentPane().repaint();}catch(Exception e){ e.printStackTrace();}
	}*/
}
